<%@ page language="java" contentType="text/html; charset=utf-8"
	pageEncoding="utf-8"%>
<%@ include file="/WEB-INF/decorators/taglibs.jsp"%>
<style>
#css_table {
	display: table;
}

.css_tr {
	display: table-row;
}

.css_td {
	display: table-cell;
	height: 40px;
}
</style>
<div class="w1a" style="height: 500px">
	<div id="css_table">
		<div class="css_tr">
			<div class="css_td" style="width: 200px;">檔案開放下載期限：</div>
			<div class="css_td" style="width: 320px;">
				<input id="active" class="easyui-slider" value="${month}"
					style="width: 300px"
					data-options="min:0,max:12,step:1,showTip:true, 
					rule: [0,'|','|',3,'|','|',6,'|','|',9,'|','|',12]" />
			</div>
			<div class="css_td" style="width: 300px;">
				(個月)&nbsp;<a href="javascript:void(0)" class="easyui-linkbutton"
					onclick="active();">存檔</a><font id="activeResult" color="red" size="3">更新成功</font>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
	$.ajaxSetup({
		cache : false,
		async : false
	});
	$(function() {
		$("#activeResult").hide();
	});
	function runEffect(id) {
		$(id).show("highlight", {}, 500, callback(id));
	}
	function callback(id) {
		setTimeout(function() {
			$(id + ":visible").fadeOut();
		}, 1500);
	}

	function active() {
		var month = $("#active").val();
		$.get("${appPath}/openTime/" + month + ".json", function(data) {
			if (eval(data)) {
				runEffect("#activeResult");
			} else {
				alert("更新失敗!");
			}
		});
	}
</script>